import 'package:flutter/material.dart';

// 定义有状态组件
// 快捷键：fstfull，得安装插件：Flutter Widget Snippets
class HomePage09 extends StatefulWidget {
  const HomePage09({Key? key}) : super(key: key);

  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage09> {
  // 状态变量
  int count = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Stack组件', style: TextStyle(color: Colors.white)),
        backgroundColor: Colors.blue,
      ),
      body: Center(
        child: Stack(
          alignment: Alignment.topCenter,
          clipBehavior: Clip.none, // 超出部分不裁剪
          children: [
            Container(width: 200, height: 200, color: Colors.green),
            Positioned(top: -100, child: Image.asset('assets/open_eyes.png')),
          ],
        ),
      ),
    );
  }
}
